package com.zdp.dubbo.simulate.framework.protocol.http;

import com.zdp.dubbo.simulate.framework.Invocation;
import com.zdp.dubbo.simulate.framework.Protocol;
import com.zdp.dubbo.simulate.framework.URL;

/**
 * @author ZhengDp
 * @Date 2023/6/4 13:10
 */
public class HttpProtocol implements Protocol {
    @Override
    public void start(URL url) {
        new HttpServer().start(url.getHostName(),Integer.valueOf(url.getPort()));
    }

    @Override
    public String send(URL url, Invocation invocation) {
        return new HttpClient().send(url.getHostName(),Integer.valueOf(url.getPort()),invocation);
    }
}
